package components
{  
    import camo.core.decal.Decal;
    
    import components.AbstractComponent;
    import components.Label;
    
    import managers.GlobalDecalSheetManager;
  
    public class DecalDisplay extends AbstractComponent  
    {  
        protected var decalInstance:Decal;  
  
        public var pixelSnapping:String = "auto";
  
        public var smoothing:Boolean = false;
		
		private var defaultSrcName: String = "";
		private var srcName: 		String = "";
		private var CountRow: 		int = 5;
  
        public function DecalDisplay(id:String)
        {
            super(this, id);
        }  
  
        public function set src(decalName:String):void  
        {  
            if (numChildren == 0)defaultSrcName = decalName;
			else srcName = decalName;
			while (numChildren != 0) removeChildAt(0); 
			decalInstance = GlobalDecalSheetManager.instance.getDecal(decalName, pixelSnapping, smoothing);  
            if (!contains(decalInstance)) addChild(decalInstance);
        }
		public function get defaultSrc() : String {  
			return defaultSrcName;  
		}
		public function get src() : String {  
			return srcName;  
		}
		public function set row(countRow:int):void {  
			CountRow = countRow;
		}
		public function get row():int {  
			return CountRow;
		}
    }  
}